<?php
include 'config.inc.php';
$username = $_POST['username'];
$nickname = $_POST['nickname'];
$result = mysql_query("update wwk_chat_user set nickname = '{$nickname}' where username = '{$username}'");
if ($result) {
  $a = array(
    'code' => 1,
    'msg' => '昵称设置成功'
  );
} else {
  $a = array(
    'code' => 0,
    'msg' => '昵称设置失败'
  );
}
echo json_encode($a);
